FROM php:7.1-apache

MAINTAINER Eyas Liu <eyasliu@163.com>

COPY sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
  bzip2 \
  libcurl4-openssl-dev \
  libicu-dev \
  libfreetype6-dev \
  libjpeg-dev \
  libmcrypt-dev \
  libmemcached-dev \
  libpng12-dev \
  libxml2-dev \
  && rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-configure gd --with-png-dir=/usr --with-freetype-dir=/usr/include/freetype2 --with-jpeg-dir=/usr \
	&& docker-php-ext-install -j$(nproc) gd exif intl mbstring mcrypt mysqli opcache pdo_mysql

COPY src /var/www/html
COPY jssdk/dist /var/www/html/jssdk
COPY entrypoint.sh /entrypoint.sh
EXPOSE 80
VOLUME /var/www/html

ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]